<?php
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile(Yii::app()->request->baseUrl.'/assets/classic/js/login/login.js', CClientScript::POS_END);
$cs->registerScriptFile(Yii::app()->request->baseUrl.'/assets/classic/plugins/icheck/icheck.min.js', CClientScript::POS_END);
$cs->registerScript("loginInit","Login.init()", CClientScript::POS_END);
?>

<!--
===========================================================
BEGIN PAGE
===========================================================
-->
<div class="login-header text-center">
    <img src="<?php echo Yii::app()->request->baseUrl; ?>/assets/classic/img/logo-login.png" class="logo" alt="Logo">
</div>
<div class="login-wrapper">
    <?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'login-form',
        'enableClientValidation'=>false,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        ),
        "action"=> Yii::app()->createUrl('login/validate'),
        "htmlOptions" => array(),
        "focus" => array($model, "username")
    )); ?>
    <?php
        $error = $model->getErrors();
        if(!empty($error)){
    ?>
        <div class="alert alert-danger alert-bold-border fade in alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <?php
                $key  = key($error);
                echo  $form->error($model, $key);

            ?>
        </div>
    <?php
        }
    ?>

    <div class="form-group has-feedback lg left-feedback no-label">
        <?php echo $form->textField($model,'username', array("class"=>"form-control no-border input-lg rounded", "placeholder"=>Yii::t("messages","User name"))); ?>
<!--        <input type="text" class="form-control no-border input-lg rounded" name="USER_NAME" placeholder="Enter username" autofocus>-->
        <span class="fa fa-user form-control-feedback"></span>
    </div>
    <div class="form-group has-feedback lg left-feedback no-label">
        <?php echo $form->passwordField($model,'password', array("class"=>"form-control no-border input-lg rounded", "placeholder"=>Yii::t("messages","Password"))); ?>
        <span class="fa fa-unlock-alt form-control-feedback"></span>
    </div>
    <div class="form-group">
        <div class="checkbox">
            <label>
                <?php echo $form->checkBox($model,'rememberMe'); ?>
                <?php echo Yii::t("messages", "Remember me")?>
            </label>
        </div>
    </div>
    <div class="form-group">
        <?php

        $login = new Kendo\UI\KButton('loginBtn');
        echo  $login->content('Login')
            ->attr("class","btn btn-warning btn-lg btn-perspective btn-block")
            ->attr("type","submit")
            ->render();
        ?>


    </div>


    <?php $this->endWidget(); ?>
</div><!-- /.login-wrapper -->
<!--
===========================================================
END PAGE
===========================================================
-->
